<?php

namespace App\Api\Controllers;

use Illuminate\Http\Request;
use App\Models\News;

class NewsController extends Controller
{
    // public function index(){
    //     header("location:".config('news'));
    // }
    public function index(News $new){
        return $this->success($new->where('status',1)->orderBy('created_at','desc')->get());
    }

    public function show(News $new){
        return $this->success($new);
    }
}
